package org.springframework.learn.beans.bpp;

import org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.learn.beans.service.OrderService;
import org.springframework.stereotype.Component;

/**
 * Description
 * Copyright © 启明星辰 版权所有
 *
 * @author chenjiquan
 * @date 2024-02-19
 */
//@Component
public class MyMergedBeanDefinitionPostProcessor implements MergedBeanDefinitionPostProcessor {
	@Override
	public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName) {
		// 修改合并之后的BD
		if(beanName.equals("userService")) {
//			beanDefinition.getPropertyValues().add("orderService", new OrderService());
			beanDefinition.setInitMethodName("init");
		}
	}
}
